package com.ril.financial.model;

import java.math.BigDecimal;
import java.util.Date;

public class BankStatement {
    private TransactionCollection _transactions;
    private BigDecimal _balance;
    private Date _begin;
    private Date _end;

    public BankStatement(Account account, TransactionCollection transactions, BigDecimal balance, Date begin, Date end) {
        _transactions = transactions;
        _balance = balance;
        _begin = begin;
        _end = end;
    }

    public BankStatement(TransactionCollection<Transaction> transactions) {
        setTransactions(transactions);

        setBalance(transactions.calculateTotal());
        setBegin(transactions.getBeginDate());
        setEnd(transactions.getEndDate());
    }

    public TransactionCollection getTransactions() {
        return _transactions;
    }

    public void setTransactions(TransactionCollection transactions) {
        _transactions = transactions;
    }

    public BigDecimal getBalance() {
        return _balance;
    }

    public void setBalance(BigDecimal balance) {
        _balance = balance;
    }

    public Date getBegin() {
        return _begin;
    }

    public void setBegin(Date begin) {
        _begin = begin;
    }

    public Date getEnd() {
        return _end;
    }

    public void setEnd(Date end) {
        _end = end;
    }
}
